package com.studysecurity.mysecurity.demo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;


@RestController
@RequestMapping("/api/v1/demo-controller")
public class DemoController {

    @GetMapping("/hello")
    public ResponseEntity<String> sayHello() {
        System.out.println("Hello 接受请求...");
        return ResponseEntity.ok("hello, world.");
    }

    @GetMapping("test")
    public String test() {
        return "Test endpoint is working!";
    }
}
